package com.baidu.ai.aip.faceDatabase;

import com.baidu.ai.aip.bean.GroupGetlistBean;
import com.baidu.ai.aip.bean.JsonBean;

import java.io.IOException;
import java.util.List;

public interface FaceDatabaseService {

    /**
     * 添加人脸
     *
     * @param imgUrl   图片路径
     * @param groupId  组别
     * @param userId   用户id
     * @param userInfo 用户信息
     * @return result:{"error_code":0,"error_msg":"SUCCESS","log_id":1535454565459,"timestamp":1584119836,"cached":0,"result":{"face_token":"41e4e3cc7426d2a1f38eadd7b229921a","location":{"left":142.45,"top":141.27,"width":198,"height":178,"rotation":2}}}
     */
    public JsonBean add(String imgUrl, String groupId, String userId, String userInfo) throws IOException;

    /**
     * 更新人脸
     *
     * @param imgUrl   图片路径
     * @param groupId  组别id
     * @param userId   用户id
     * @param userInfo 用户信息
     * @return
     */
    public String update(String imgUrl, String groupId, String userId, String userInfo) throws IOException;

    /**
     * 用户删除
     *
     * @param groupId 组别id
     * @param userId  用户id
     * @return
     */
    public String userDelete(String groupId, String userId) throws Exception;

    /**
     * 用户信息获取
     *
     * @param groupId 组别id
     * @param userId  用户id
     * @return
     */
    public String userGet(String groupId, String userId);

    /**
     * 创建用户组
     *
     * @param groupId 组别id
     * @return
     */
    public String groupAdd(String groupId);

    /**
     * 删除用户组
     *
     * @param groupId 组别id
     * @return
     */
    public String groupDelete(String groupId);

    public List<String> getUsers(String groupId);


    public GroupGetlistBean groupGetlist();

}
